package user;

import books.Book;
import books.BookList;
import operation.*;

import java.util.Scanner;

public class OrdUser extends User{
    public OrdUser(){
        this.iOperations = new IOperation[]{
                new ExitOperation(),
                new SearchOperation(),
                new BorrowOperation(),
                new ReturnOperation()
        };
    }

    public int menu() {
        Scanner scan = new Scanner(System.in) ;
        while(true){
            System.out.println("================");
            System.out.println("1. 搜索图书");
            System.out.println("2. 借阅图书");
            System.out.println("3. 归还图书");
            System.out.println("0. 退出系统");
            System.out.println("================");
            System.out.println("请输入->");
            int tmp = scan.nextInt() ;
            if(tmp <=3 && tmp >=0){
                return tmp ;
            }else {
                System.out.println("输入错误请重新输入");
            }
        }
    }
}